#pragma once

#include "../../game/Player.h"
#include <QLabel>
#include <QListWidget>
#include <QPushButton>
#include <QVBoxLayout>
#include <QVector>
#include <QWidget>

static const QString START_TEXT = "开始游戏";
static const QString FINISH_TEXT = "结束游戏";

class GamePanel : public QWidget {
    Q_OBJECT
private:
    QLabel* list_label;
    QListWidget* player_list;
    QVBoxLayout* widget_layout;
    QPushButton* start_button;

    QVector<Player*> players;

public:
    explicit GamePanel(QWidget* parent);

    void addPlayer(const QString& name);
    void removePlayer(const QString& name);

    void enable();
    void disable(bool all = true);

public slots:
    void onStartButtonClicked();

signals:
#pragma clang diagnostic push
#pragma ide diagnostic ignored "NotImplementedFunctions"
    void started();
    void finished();
#pragma clang diagnostic pop
};
